home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / tydhtml / dyn.exe / CHAP10 / dyn10_3.txt < prev    next >
Encoding:
Text File  |  1997-10-02  |  3.0 KB  |  89 lines

  1. <HTML>
  2.  
  3. <HEAD>
  4.  
  5. </HEAD>
  6.  
  7. <BODY onload="cycle();">
  8.  
  9. <H2 ID=sg STYLE="color:Black;">Shell Game</H2>
  10.  
  11. <IMG SRC="gem.gif" ID=gem BORDER=0
  12.  
  13.  STYLE="container:positioned;position:absolute;
  14.  
  15.  TOP:192pt;LEFT:142px;WIDTH:32px;HEIGHT:32px;ZINDEX:0;">
  16.  
  17. <IMG SRC="walnut.gif" ID=shell1 BORDER=0 onclick="Guess();"
  18.  
  19.  STYLE="container:positioned;position:absolute;
  20.  
  21.  TOP:50pt;LEFT:0px;WIDTH:64px;HEIGHT:64px;ZINDEX:1;">
  22.  
  23. <IMG SRC="walnut.gif" ID=shell2 BORDER=0 onclick="Guess();"
  24.  
  25.  STYLE="container:positioned;position:absolute;
  26.  
  27.  TOP:50pt;LEFT:142px;WIDTH:64px;HEIGHT:64px;ZINDEX:2;">
  28.  
  29. <IMG SRC="walnut.gif" ID=shell3 BORDER=0 onclick="Guess();"
  30.  
  31.  STYLE="container:positioned;position:absolute;
  32.  
  33.  TOP:50pt;LEFT:284px;WIDTH:64px;HEIGHT:64px;ZINDEX:3;">
  34.  
  35. <OBJECT ID="pathone"
  36.  
  37.         CLASSID="CLSID:E0E3CC60-6A80-11D0-9B40-00A0C903AA7F">
  38.  
  39. <PARAM NAME=XSeries
  40.  
  41.         VALUE="0,0;10,126;20,0;30,284;40,0;50,142;60,284;70,142;80,142">
  42.  
  43. <PARAM NAME=YSeries
  44.  
  45.         VALUE="0,50;10,176;20,50;30,176;40,50;50,176;60,50;70,176;80,50">
  46.  
  47. </OBJECT>
  48.  
  49. <OBJECT ID="pathtwo"
  50.  
  51.         CLASSID="CLSID:E0E3CC60-6A80-11D0-9B40-00A0C903AA7F">
  52.  
  53. <PARAM NAME=XSeries
  54.  
  55.         VALUE="0,142;10,142;20,142;30,142;40,284;50,0;60,0;70,0;80,284">
  56.  
  57. <PARAM NAME=YSeries
  58.  
  59.         VALUE="0,50;10,50;20,50;30,176;40,50;50,176;60,50;70,176;80,50">
  60.  
  61. </OBJECT>
  62.  
  63. <OBJECT ID="paththree"
  64.  
  65.         CLASSID="CLSID:E0E3CC60-6A80-11D0-9B40-00A0C903AA7F">
  66.  
  67. <PARAM NAME=XSeries
  68.  
  69.         VALUE="0,284;10,284;20,284;30,0;40,142;50,284;60,142;70,284;80,0">
  70.  
  71. <PARAM NAME=YSeries
  72.  
  73.         VALUE="0,50;10,50;20,50;30,176;40,50;50,176;60,50;70,176;80,50">
  74.  
  75. </OBJECT>
  76.  
  77. <OBJECT ID="pathfour"
  78.  
  79.         CLASSID="CLSID:E0E3CC60-6A80-11D0-9B40-00A0C903AA7F">
  80.  
  81. <PARAM NAME=XSeries
  82.  
  83.         VALUE="0,142;10,142;20,16;30,300;40,16;50,158;60,300;70,158;80,158">
  84.  
  85. <PARAM NAME=YSeries
  86.  
  87.         VALUE="0,192;10,192;20,66;30,192;40,66;50,192;60,66;70,192;80,66">
  88.  
  89. </OBJECT>
  90.  
  91. <SCRIPT LANGUAGE=VBScript>
  92.  
  93. function cycle()
  94.  
  95.         dim itimer
  96.  
  97.         pathone.Target = shell1.Style
  98.  
  99.         pathtwo.Target = shell2.Style
  100.  
  101.         paththree.Target = shell3.Style
  102.  
  103.         pathfour.Target = gem.Style
  104.  
  105.         shell1.style.visibility="visible"
  106.  
  107.         shell2.style.visibility="visible"
  108.  
  109.         shell3.style.visibility="visible"
  110.  
  111.         gem.style.visibility="visible"
  112.  
  113.         pathone.Play
  114.  
  115.         pathtwo.Play
  116.  
  117.         paththree.Play
  118.  
  119.         pathfour.Play
  120.  
  121.         itimer = setTimeout( "Moves()", 50)
  122.  
  123. End function
  124.  
  125.  
  126.  
  127. Sub Moves
  128.  
  129.         dim itimer
  130.  
  131.         pathone.Tick
  132.  
  133.         pathtwo.Tick
  134.  
  135.         paththree.Tick
  136.  
  137.         pathfour.Tick
  138.  
  139.         if currentTick < 9 then
  140.  
  141.             itimer = setTimeout("Moves()", 50)
  142.  
  143.         end if
  144.  
  145. End Sub
  146.  
  147. </SCRIPT>
  148.  
  149.  
  150.  
  151. <SCRIPT LANGUAGE=VBScript>
  152.  
  153. function Guess()
  154.  
  155.   dim r, srcElement
  156.  
  157.   set srcElement = window.event.srcElement
  158.  
  159.   if (srcElement.id="shell1") then
  160.  
  161.      srcElement.src = "gem.gif"
  162.  
  163.   else
  164.  
  165.      srcElement.src = "wrong.gif"
  166.  
  167.   end if
  168.  
  169. end function
  170.  
  171. </SCRIPT>
  172.  
  173. </BODY>
  174.  
  175. </HTML>
  176.  
  177.